/* Copyright 2013-2015 www.snakerflow.com.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.snaker.engine.entity;

import java.io.Serializable;
import java.util.Map;
import org.snaker.engine.TgSnakerUitl;
import lombok.Data;

/**
 * 流程工作单实体类（一般称为流程实例）
 * 
 * @author yuqs
 * @since 1.0
 */
@Data
public class Order implements Serializable {
    private static final long serialVersionUID = -8335779448165343933L;
    private String id; // 主键ID
    private Integer version = 0; // 版本
    private String processId; // 流程定义ID
    private String creator; // 流程实例创建者ID
    private String createTime; // 流程实例创建时间
    private String parentId; // 流程实例为子流程时，该字段标识父流程实例ID
    private String parentNodeName; // 流程实例为子流程时，该字段标识父流程哪个节点模型启动的子流程
    private String expireTime; // 流程实例期望完成时间
    private String lastUpdateTime; // 流程实例上一次更新时间
    private String lastUpdator; // 流程实例上一次更新人员ID
    private Integer priority; // 流程实例优先级
    private String orderNo; // 流程实例编号
    private String variable; // 流程实例附属变量

    /**
     * getVariableMap
     */
    public Map<String, Object> getVariableMap() {
        return TgSnakerUitl.getVariableMap(this.variable);
    }
}
